NHANES$MARRIED).
Interpreting the output from a t test
Listing 11-1 is the output from a one-sample t-test, where we tested the mean fasting glucose in the
NHANES participants against the hypothesized mean of 100 mg/dL:
LISTING 11-1 R Output from a One-Sample Student t Test
> t.test(GLUCOSE$LBXGLU, mu = 100)
One Sample t-test
data: GLUCOSE$LBXGLU
t = 21.209, df = 4743, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 100
95 percent confidence interval:
110.1485 112.2158
sample estimates:
mean of x
111.1821
The R output starts by stating what test was run and what data were used, and then reports the t statistic
(21.209), the df (4743), and the p value, which is written in scientific notation: < 2.2e–16. If you have
trouble interpreting this notation, just remove the < and then copy and paste the rest of the number into
a cell in Microsoft Excel. If you do that, you will see in the formula bar that the number resolves to
0.00000000000000022 — which is a very low p value! The shorthand used for this in biostatistics is
p < 0.0001, meaning it is sufficiently small. Because of this small p value, we reject the null
hypothesis and say that the mean glucose of NHANES participants is statistically significantly different
from 100 mg/dL.
But in what direction? For that, it is necessary to read down further in the R output, under 95 percent
confidence interval. It says the interval is 110.1485 mg/dL to 112.2158 mg/dL (if you need a refresher
on confidence intervals, read Chapter 10). Because the entire interval is greater than 100 mg/dL, you
can conclude that the NHANES mean is statistically significantly greater than 100 mg/dL.
Now, let’s examine the output from the paired t test of SBP measured two times in the same participant,
which is shown in Listing 11-2.
LISTING 11-2 R Output from a Paired Student t Test
> t.test(BP$BPXOSY1, BP$BPXOSY2, paired = TRUE)
Paired t-test
data: BP$BPXOSY1 and BP$BPXOSY2
t = 4.3065, df = 10325, p-value = 1.674e–05
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
0.1444651 0.3858467
sample estimates:
mean difference
0.2651559
Notice a difference between the output shown in Listings 11-1 and 11-2. In Listing 11-1, the third line
of output says, “alternative hypothesis: true mean is not equal to 100.” That is because we specified
the null hypothesis of 100 when we coded the one-sample t test. Because we did a paired t test in
Listing 11-2, this null hypothesis now concerns 0 because we are trying to see if there is a statistically
significant difference between the first SBP reading and the second in the same individuals. Why